/*************************************************************************
	> File Name: Bridge.cc
	> Author: Joker
	> Mail: mahongtao@foxmail.com 
	> Created Time: 2020-09-21 22:26:48
 ************************************************************************/

#include "Bridge.h"

#include <iostream>

using std::cout;
using std::endl;

void ConcreateImplementorA::OperationImpl(){
    cout << "Implementor by ConcreateImplementorA" << endl;
}

void ConcreateImplementorB::OperationImpl(){
    cout << "Implementor by ConcreateImplementorB" << endl;
}

Abstraction::Abstraction(Implementor * pImplementor)
    :_pImplementor(pImplementor)
{
    cout << "Abstraction(Implementor *)" << endl;
}

Abstraction::~Abstraction(){
    cout << "~Abstraction()" << endl;
    delete _pImplementor;
    _pImplementor = nullptr;
}

void Abstraction::Operation(){
    _pImplementor->OperationImpl();
}
